import {RouteRecordRaw} from "vue-router";

export default [
    {
        path: '/admin',
        redirect: {name: 'user.index'},
        component: () => import('@/layouts/admin.vue'),
        meta: {auth: true, menu: {title: '用户管理', sort: 1, icon: "EveryUser"}},
        children: [
            {
                path: 'user/index',
                name: 'user.index',
                meta:{menu:{title:'用户列表',routeName:'user.index'}},
                component: () => import('@/views/admin/user/index.vue')
            },
        ]
    },
    {
        path: '/admin/cat',
        redirect: {name: 'cat.index'},
        component: () => import('@/layouts/admin.vue'),
        meta: {auth: true, menu: {title: '帖子大类管理', sort: 2, icon:"AllApplication"}},
        children: [
            {
                path: 'index',
                name: 'cat.index',
                meta:{menu:{title:'帖子大类列表',routeName:'cat.index'}},
                component: () => import('@/views/admin/cat/index.vue')
            },
            {
                path: 'add',
                name: 'cat.add',
                meta:{menu:{title:'添加帖子大类',routeName:'cat.add'}},
                component: () => import('@/views/admin/cat/add.vue')
            },
            {path: 'edit', name: 'cat.edit', component: () => import('@/views/admin/cat/edit.vue')},
        ]
    },
    {
        path: '/admin/topic',
        redirect: {name: 'topic.index'},
        component: () => import('@/layouts/admin.vue'),
        meta: {auth: true, menu: {title: '帖子管理', sort: 3, icon:"FourRoundPointConnection"}},
        children: [
            {
                path: 'index',
                name: 'topic.index',
                component: () => import('@/views/admin/topic/index.vue'),
                meta:{menu:{title:'帖子列表',routeName:'topic.index'}},
            },
            {
                path: 'add',
                name: 'topic.add',
                component: () => import('@/views/admin/topic/add.vue'),
                meta:{menu:{title:'添加帖子',routeName:'topic.add'}},
            },
            {path: 'edit',  name: 'topic.edit', component: () => import('@/views/admin/topic/edit.vue')},
        ]
    },
] as RouteRecordRaw[];